package com.changgou.goods.config;

import com.changgou.util.IdWorker;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: HuangFu
 * @Date: 2020/1/17 16:27
 * @Description: 全局配置中心
 */
@Configuration
public class GoodsConfiguration {

    /**
     * 加载分布式ID生成器
    * @return
     */
    @Bean
    @ConfigurationProperties(prefix ="system.idworker")
    public IdWorker getIdWorker(){
        return new IdWorker();
    }
}
